
package com.eyedog.video.search;

import com.eyedog.library.mvp.BasePresenter;
import com.eyedog.video.entity.ADVEntity;
import com.eyedog.video.entity.CategoryEntity;
import com.eyedog.video.entity.HotTagEntity;
import com.eyedog.video.http.ICallback;

import java.util.List;

public class SearchPresenter extends BasePresenter<constract.ISearchView, constract.ISearchModel>
        implements constract.ISearchPresenter {

    public SearchPresenter(constract.ISearchView iSearchView, constract.ISearchModel iSearchModel) {
        super(iSearchView, iSearchModel);
    }

    @Override
    public void displaySearch() {
        model.loadSearchHeaderAdv(new ICallback<ADVEntity>() {
            @Override
            public void onLoadSuccess(ADVEntity advEntity) {
                view.showSearchHeaderAdv(advEntity);
            }

            @Override
            public void onLoadFailed(String err) {
            }
        });
        model.loadSearchCategorys(new ICallback<List<CategoryEntity>>() {
            @Override
            public void onLoadSuccess(List<CategoryEntity> categoryEntities) {
                view.showSearchCategorys(categoryEntities);
            }

            @Override
            public void onLoadFailed(String err) {
            }
        });
        model.loadSearchTailAdv(new ICallback<ADVEntity>() {
            @Override
            public void onLoadSuccess(ADVEntity advEntity) {
                view.showSearchTailAdv(advEntity);
            }

            @Override
            public void onLoadFailed(String err) {
            }
        });

        model.loadHotTags(new ICallback<List<HotTagEntity>>() {
            @Override
            public void onLoadSuccess(List<HotTagEntity> hotTagEntities) {
                view.showHotTags(hotTagEntities);
            }

            @Override
            public void onLoadFailed(String err) {
            }
        });
    }
}
